package azcat.planner.workers;

import java.util.ArrayList;
import java.util.HashMap;

import azcat.planner.schedule.Schedule;

public class Worker {
	private String fName;
	private String lName;
	private ArrayList<String> workingDays = new ArrayList<String>();
	private ArrayList<Schedule> schedule = new ArrayList<Schedule>();
	private HashMap<String, String> available = new HashMap<String, String>();
	private ArrayList<String> workingOnTool = new ArrayList<String>();
	
	
	public String getWorkingOnTool(int index) {
		//System.out.println(index);
		return workingOnTool.get(index);
	}

	public void setWorkingOnTool(String tool) {
		this.workingOnTool.add(tool);
	}

	private HashMap<String, Integer> dayofweek = new HashMap<String, Integer>();
	
	public Worker(){
		setDaysofWeek();
	}
	
	public void setAvailable(String day, String ava){
		if(day.equals("u")){
			available.put("1", ava);
			
		}
		else if(day.equals("m")){
			available.put("2", ava);
		}
		else if(day.equals("t")){
			available.put("3", ava);
		}
		else if(day.equals("w")){
			available.put("4", ava);
		}
		else if(day.equals("r")){
			available.put("5", ava);
		}
		else if(day.equals("f")){
			available.put("6", ava);
		}
		else if(day.equals("s")){
			available.put("7", ava);
		}
		
	}
	
	public String getAvailable(String key){
		return available.get(key);				
	}	
	
	public String getfName() {
		return fName;
	}
	public void setfName(String fName) {
		this.fName = fName;
	}
	public String getlName() {
		return lName;
	}
	public void setlName(String lName) {
		this.lName = lName;
	}
	public ArrayList<String> getWorkingDays() {
		return workingDays;
	}
	public void setWorkingDays(ArrayList<String> workingDays) {
		this.workingDays = workingDays;
	}
	public ArrayList<Schedule> getSchedule() {
		return schedule;
	}
	public void setSchedule(ArrayList<Schedule> schedule, String tool) {
		for(int i=0; i < schedule.size(); i++){
			this.schedule.add(schedule.get(i));
			this.workingOnTool.add(tool);
		}
		
	}
	
	private void setDaysofWeek(){
		dayofweek.put("	u", 1);
		dayofweek.put("	m", 2);
		dayofweek.put("	t", 3);
		dayofweek.put("	w", 4);
		dayofweek.put("	r", 5);
		dayofweek.put("	f", 6);
		dayofweek.put("	s", 7);
		
		available.put("1", "0");
		available.put("2", "0");
		available.put("3", "0");
		available.put("4", "0");
		available.put("5", "0");
		available.put("6", "0");
		available.put("7", "0");



	}

}
